/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package nhadat.action.form;

import javax.servlet.http.HttpServletRequest;
import nhadat.dao.KhuVucDAO;
import nhadat.dao.LoaiGiayToDAO;
import nhadat.dao.LoaiNhaDAO;
import nhadat.dao.LoaiTinDAO;
import nhadat.dao.TindangDao;
import nhadat.entity.GiaTienSearch;
import nhadat.entity.TblLoaiGiayTo;
import nhadat.entity.TblLoaiNha;
import nhadat.entity.TblLoaiTin;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;
import org.apache.struts.upload.FormFile;

/**
 *
 * @author Xe Bay
 */
public class TaoTinDangActionForm extends org.apache.struts.action.ActionForm {
    
    private String loaitin;
    private TblLoaiTin[] dsLoaitin;
    private String tinhthanh;
    private String quanhuyen;
    private String[] dsKhuVuc;
    private String[] dsQuanHuyenThuocTinhThanh;
    private String loainha;
    private TblLoaiNha[] dsLoaiNha;
    private String loaiGiayTo;
    private TblLoaiGiayTo[] dsLoaiGiayTo;
    private String[] dsDvdGiaTien;

    public String[] getDsDvdGiaTien() {
        return dsDvdGiaTien;
    }

    public void setDsDvdGiaTien(String[] dsDvdGiaTien) {
        this.dsDvdGiaTien = dsDvdGiaTien;
    }

    public String[] getDsKhuVuc() {
        return dsKhuVuc;
    }

    public void setDsKhuVuc(String[] dsKhuVuc) {
        this.dsKhuVuc = dsKhuVuc;
    }

    public TblLoaiGiayTo[] getDsLoaiGiayTo() {
        return dsLoaiGiayTo;
    }

    public void setDsLoaiGiayTo(TblLoaiGiayTo[] dsLoaiGiayTo) {
        this.dsLoaiGiayTo = dsLoaiGiayTo;
    }

    public TblLoaiNha[] getDsLoaiNha() {
        return dsLoaiNha;
    }

    public void setDsLoaiNha(TblLoaiNha[] dsLoaiNha) {
        this.dsLoaiNha = dsLoaiNha;
    }

    public TblLoaiTin[] getDsLoaitin() {
        return dsLoaitin;
    }

    public void setDsLoaitin(TblLoaiTin[] dsLoaitin) {
        this.dsLoaitin = dsLoaitin;
    }

    public String getLoaiGiayTo() {
        return loaiGiayTo;
    }

    public void setLoaiGiayTo(String loaiGiayTo) {
        this.loaiGiayTo = loaiGiayTo;
    }

    public String getLoainha() {
        return loainha;
    }

    public void setLoainha(String loainha) {
        this.loainha = loainha;
    }

    public String getLoaitin() {
        return loaitin;
    }

    public void setLoaitin(String loaitin) {
        this.loaitin = loaitin;
    }

    public String getQuanhuyen() {
        return quanhuyen;
    }

    public void setQuanhuyen(String quanhuyen) {
        this.quanhuyen = quanhuyen;
    }

    public String getTinhthanh() {
        return tinhthanh;
    }

    public void setTinhthanh(String tinhthanh) {
        this.tinhthanh = tinhthanh;
    }
    public String[] getDsQuanHuyenThuocTinhThanh() {
        KhuVucDAO khuvucDAO = new KhuVucDAO();
        return khuvucDAO.getAllQuanHuyenByTinhThanh(tinhthanh);
    }

    public void setDsQuanHuyenThuocTinhThanh(String[] dsQuanHuyenThuocTinhThanh) {
        this.dsQuanHuyenThuocTinhThanh = dsQuanHuyenThuocTinhThanh;
    }

    public TaoTinDangActionForm() {
    }

    public void getAllLoaiTin() {
        LoaiTinDAO loaiTinDAO = new LoaiTinDAO();
        dsLoaitin = loaiTinDAO.getAllLoaiTin();
    }

    public void getAllKhuVuc() {
        KhuVucDAO khuVucDAO = new KhuVucDAO();
        dsKhuVuc = khuVucDAO.getAllTinhThanh();
    }

    public void getAllLoaiNha() {
        LoaiNhaDAO loaiNhaDAO = new LoaiNhaDAO();
        dsLoaiNha = loaiNhaDAO.getAllLoaiNha();
    }

    public void getAllLoaiGiayTo() {
        LoaiGiayToDAO loaiGiayToDAO = new LoaiGiayToDAO();
        dsLoaiGiayTo = loaiGiayToDAO.getAllLoaiGiayTo();
    }

    public void getAllDvdGiaTien() {
        TindangDao tindangDAO = new TindangDao();
        dsDvdGiaTien = tindangDAO.getAllDvdGiaTien();
    }
    public void initialDangTinInfo() {
        getAllLoaiTin();
        getAllKhuVuc();
        if ("".equals(tinhthanh) && (null != dsKhuVuc)) {
            tinhthanh = dsKhuVuc[0];
        }
        getAllLoaiGiayTo();
        getAllLoaiNha();
        getAllDvdGiaTien();
    }
}
